// poj 2352
// http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=binaryIndexedTrees

#include <iostream>
#include <map>
#include <algorithm>
using namespace std;

int num[16000];
int n;

// 1-based
template <typename T, int MaxIntervalLength>
class BinaryIndexedTree
{
public:
	void init(int length, T zeroValue)
	{
		len = length;
		for (int i = 1; i <= length; i++)
			tree[i] = zeroValue;
	}
	// return the sum of range 1~idx
	T read(int idx, T zeroValue)
	{
		T sum = zeroValue;
		while (idx > 0)
		{
			sum += tree[idx];
			idx -= (idx & -idx);
		}
		return sum;
	}
	// update the value at idx with val
	void update(int idx, T val)
	{
		while (idx <= len)
		{
			tree[idx] += val;
			idx += (idx & -idx);
		}
	}
	T readSingle(int idx)
	{
		T sum = tree[idx];
		if (idx > 0)
		{
			int z = idx - (idx & -idx);
			idx--;
			while (idx != z)
			{
				sum -= tree[idx]; 
				idx -= (idx & -idx);
			}
		}
		return sum;
	}
private:
	T tree[MaxIntervalLength + 1];
	int len;
};

// 1-based
template <typename T, int MaxRow, int MaxCol>
class TwoDBinaryIndexedTree
{
public:
	void init(int rowCount, int colCount, T zeroValue)
	{
		row = rowCount;
		col = colCount;
		for (int i = 1; i <= row; i++)
			for (int j = 1; j <= col; j++)
				tree[i][j] = zeroValue;
	}
	// return the sum of (1, 1) ~ (x, y)
	T read(int x, int y, T zeroValue)
	{
		T sum = zeroValue;
		while (x > 0)
		{
			int yy = y;
			while (yy > 0)
			{
				sum += tree[x][yy];
				yy -= (yy & -yy);
			}
			x -= (x & -x);
		}
		return sum;
	}
	// update the value at (x, y) with val
	void update(int x, int y, T val)
	{
		while (x <= row)
		{
			int yy = y;
			while (yy <= col)
			{
				tree[x][yy] += val;
				yy += (yy & -yy);
			}
			x += (x & -x);
		}
	}
private:
	T tree[MaxRow + 1][MaxCol + 1];
	int row, col;
};


BinaryIndexedTree<int, 32009> bitree;

int main()
{
	bitree.init(32001, 0);
	memset(num, 0, sizeof(num));
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		int x, y;
		scanf("%d%d", &x, &y);
		int sum = bitree.read(x + 1, 0);
		num[sum]++;
		bitree.update(x + 1, 1);
	}
	for (int i = 0; i < n; i++)
		printf("%d\n", num[i]);
	system("pause");
	return 0;
}